package org.idea.spring.bean.beandestory;

import org.idea.spring.bean.beaninstance.factory.UserFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * @Author idea
 * @Date created in 5:20 下午 2020/7/18
 */
public class DestoryUserBean implements DestoryUserBeanFactory , InitializingBean , DisposableBean {

    @PostConstruct
    public void init(){
        System.out.println("this is init");
    }

    @PreDestroy
    public void predestory(){
        System.out.println("this is predestory");
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("disposable===");
    }

    public void init2(){
        System.out.println("this is init2");
    }

    public void destory2(){
        System.out.println("this is destory2");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("afterpropertiesset =======");
    }
}
